package com.jack.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * Created by LiJiakui on 17/4/13.
 */
@RestController
public class ToSay {
    @Autowired
    RestTemplate restTemplate;

    @RequestMapping("/say/{name}")
    public String say(@PathVariable("name") String name){
        return restTemplate.getForEntity("http://hello-provider/say?username="+name,String.class).getBody();
    }
}
